package com.info.biz;

import java.util.ArrayList;
import java.util.List;

import com.info.data.BaseProvider;
import com.info.entidy.KpiDefine;

public class KpiBiz {

	private BaseProvider provider=new BaseProvider();
	
	public List<KpiDefine> getKpiDefine(String kpiName){
		
		List<KpiDefine> list= provider.getKpiDefine("", kpiName);
		return list;
	}
	
	public List<KpiDefine> getKpiDefine(String a,String b){
		List<KpiDefine> list=new ArrayList<KpiDefine>();
		for (int i = 1; i <= 5; i++) {
			KpiDefine kpi=new KpiDefine();
			kpi.setKpi_name_en("kpi_name_en_"+i);
			kpi.setKpi_desc("kpi_name_cn_"+i);
			kpi.setVersion("XXX");
			kpi.setAuthor("ddd");
			list.add(kpi);
		}
		return list;
	}
	
	public boolean updateKpiDefine(List<KpiDefine> list){
		boolean flag=false;
		try {
			if(list!=null && list.size()>0){
				flag= provider.updateKpiDefine(list);
			}
			
		} catch (Exception e) {
			// TODO: handle exception
		}
		return flag; 
	}
	
	public boolean deleteKpi(List list){
		return provider.deleteKpiDefine(list);
//		return true;
	};
}
